package com.klikmee.sms.services.chat.model;

import java.io.Serializable;
import javax.persistence.*;

import java.util.Set;

/**
 * The persistent class for the Agent database table.
 * 
 */
@Entity
@Table(name="agent")
@NamedQueries({ @NamedQuery(name = "Agent.findByUsername", query = "SELECT a FROM Agent a WHERE a.agentUserName = :username AND a.agentPassword = :password"), 
				@NamedQuery(name = "Agent.findAll", query = "SELECT a FROM Agent a"), 
				@NamedQuery(name = "Agent.findByGroup", query = "SELECT a FROM Agent a INNER JOIN a.agentGroups ag WHERE ag.group = :group") 
			})
public class Agent implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "AgentID")
	private int agentID;

	@Column(name = "Active")
	private Boolean active;

	@Column(name = "AgentEmail")
	private String agentEmail;

	@Column(name = "AgentFirstName")
	private String agentFirstName;

	@Column(name = "AgentLastName")
	private String agentLastName;

	@Column(name = "AgentPassword")
	private String agentPassword;

	@Column(name = "AgentPhone")
	private String agentPhone;

	@Column(name = "AgentUserName")
	private String agentUserName;

	// bi-directional many-to-one association to AgentGroup
	@OneToMany(mappedBy = "agent")
	private Set<AgentGroup> agentGroups;

	// bi-directional many-to-one association to QuestionResponsibility
	@OneToMany(mappedBy = "agent")
	private Set<QuestionResponsibility> questionResponsibilities;

	public Agent() {
		this.setActive(Boolean.FALSE);
	}

	public int getAgentID() {
		return this.agentID;
	}

	public void setAgentID(int agentID) {
		this.agentID = agentID;
	}

	public boolean getActive() {
		return this.active;
	}

	public void setActive(Boolean active) {
		this.active = active;
	}

	public String getAgentEmail() {
		return this.agentEmail;
	}

	public void setAgentEmail(String agentEmail) {
		this.agentEmail = agentEmail;
	}

	public String getAgentFirstName() {
		return this.agentFirstName;
	}

	public void setAgentFirstName(String agentFirstName) {
		this.agentFirstName = agentFirstName;
	}

	public String getAgentLastName() {
		return this.agentLastName;
	}

	public void setAgentLastName(String agentLastName) {
		this.agentLastName = agentLastName;
	}

	public String getAgentPassword() {
		return this.agentPassword;
	}

	public void setAgentPassword(String agentPassword) {
		this.agentPassword = agentPassword;
	}

	public String getAgentPhone() {
		return this.agentPhone;
	}

	public void setAgentPhone(String agentPhone) {
		this.agentPhone = agentPhone;
	}

	public String getAgentUserName() {
		return this.agentUserName;
	}

	public void setAgentUserName(String agentUserName) {
		this.agentUserName = agentUserName;
	}

	public Set<AgentGroup> getAgentGroups() {
		return this.agentGroups;
	}

	public void setAgentGroups(Set<AgentGroup> agentGroups) {
		this.agentGroups = agentGroups;
	}

	public Set<QuestionResponsibility> getQuestionResponsibilities() {
		return this.questionResponsibilities;
	}

	public void setQuestionResponsibilities(Set<QuestionResponsibility> questionResponsibilities) {
		this.questionResponsibilities = questionResponsibilities;
	}

}